﻿<%@ Page Title="" Language="C#" MasterPageFile="~/NewTemplate.Master" AutoEventWireup="true" CodeBehind="CreateEvent.aspx.cs" Inherits="PresentationLayer.CreateEvent" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="server">
    <title></title>
    
    <style type="text/css">
        .Col1 
        {
            width: 90px;
        }
        .Col2
        {
            width: 410px;
        }
        .AddedOptions 
        {
            width:500px;
            text-align: left;
        }
        .OptionNumber 
        {
            font-style: italic;
            vertical-align: top;
            width: 20px;
            background-color: #cccccc;
        }
        .OptionValues 
        {
            background-color: #cccccc;
        }
        .OptionValues p
        {
            margin: 0px auto;
        }
    </style>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlace" runat="server">

    <h1>Create Event</h1>

    <h3>General settings</h3>
    <table>
        <colgroup>
            <col class="Col1" />
            <col class="Col2" />                        
            <col class="Col3" />
        </colgroup>
        <tr>
            <td>
                Name:</td>
            <td>
                <asp:TextBox ID="eventName" runat="server" class="TextInput"></asp:TextBox>
            </td>
            <td>
                <asp:RequiredFieldValidator ID="requiredName" runat="server" Display="Dynamic"
                    ControlToValidate="eventName"
                    Text="<img src='gfx/redCheck.png' alt='*' title='Please insert a name for the event.' />">
                </asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="regexName" runat="server" Display="Dynamic"
                    ControlToValidate="eventName"
                    ValidationExpression="^[^<>]+$"
                    Text="<img src='gfx/redCheck.png' alt='*' title='Name contains illegal characters.' />">
                </asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td colspan="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <asp:RadioButton ID="Visiblity_Private" runat="server" GroupName="Visiblity" 
                    Text="Private Event" />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <asp:RadioButton ID="Visiblity_Public" runat="server" GroupName="Visiblity" 
                    Text="Public Event" />
            </td>
        </tr>
    </table>

    <h3>Location settings</h3>
    <div id="viewLoc" runat="server">
    </div>
    <table>
        <colgroup>
            <col class="Col1" />
            <col class="Col2" />                        
            <col class="Col3" />
        </colgroup>
        <tr>
            <td>
                Location:</td>
            <td>
                <asp:TextBox ID="locationName" runat="server" class="TextInput"></asp:TextBox>
            </td>
            <td>
                <asp:RegularExpressionValidator ID="regexLocation" runat="server" Display="Dynamic"
                    ControlToValidate="locationName"
                    ValidationExpression="^[^<>]+$"
                    Text="<img src='gfx/redCheck.png' alt='*' title='Name contains illegal characters.' />">
                </asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td>
                Country:*</td>
            <td>
                <asp:TextBox ID="country" runat="server" class="TextInput"></asp:TextBox>
            </td>
            <td>
                <asp:RegularExpressionValidator ID="regexCountry" runat="server" Display="Dynamic"
                    ControlToValidate="country"
                    ValidationExpression="^\s*[A-Za-z]+([-\s][A-Za-z]+|[A-Za-z]+)*\s*$"
                    Text="<img src='gfx/redCheck.png' alt='*' title='Country contains illegal characters.' />">
                </asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td>
                City:*</td>
            <td>
                <asp:TextBox ID="city" runat="server" class="TextInput"></asp:TextBox>
            </td>
            <td>
                <asp:RegularExpressionValidator ID="regexCity" runat="server" Display="Dynamic"
                    ControlToValidate="city"
                    ValidationExpression="^\s*[A-Za-z0-9]+([-\s][A-Za-z0-9]+|[A-Za-z0-9]+)*\s*$"
                    Text="<img src='gfx/redCheck.png' alt='*' title='City contains illegal characters.' />">
                </asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td>
                Address:*</td>
            <td>
                <asp:TextBox ID="addressA" runat="server" class="TextInput"></asp:TextBox>
            </td>
            <td>
                <asp:RegularExpressionValidator ID="regexAddressA" runat="server" Display="Dynamic"
                    ControlToValidate="addressA"
                    ValidationExpression="^\s*[A-Za-z0-9]+([-\s/][A-Za-z0-9]+|[A-Za-z0-9]+)*\s*$"
                    Text="<img src='gfx/redCheck.png' alt='*' title='Address contains illegal characters.' />">
                </asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td>
                &nbsp 
            </td>
            <td>
                <asp:TextBox ID="addressB" runat="server" class="TextInput"></asp:TextBox>
            </td>
            <td>
                <asp:RegularExpressionValidator ID="regexAddessB" runat="server" Display="Dynamic"
                    ControlToValidate="addressB"
                    ValidationExpression="^\s*[A-Za-z0-9]+([-\s/][A-Za-z0-9]+|[A-Za-z0-9]+)*\s*$"
                    Text="<img src='gfx/redCheck.png' alt='*' title='Address contains illegal characters.' />">
                </asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td>
                &nbsp 
            </td>
            <td class="ButtonCell">
                <asp:Button ID="addLocation" runat="server" Text="Add Location" OnClick="AddLocation" />
            </td>
            <td></td>
        </tr>
    </table>

    <h3>Date settings</h3>
    <div id="viewD" runat="server">
    </div>
    <table>
        <colgroup>
            <col class="Col1" />
            <col class="Col2" />                        
            <col class="Col3" />
        </colgroup>
        <tr>
            <td>
                Date:</td>
            <td>
                <asp:TextBox ID="date" runat="server" class="TextInput"></asp:TextBox>
            </td>
            <td>
                <asp:RegularExpressionValidator ID="regexDate" runat="server" Display="Dynamic"
                    ControlToValidate="date"
                    ValidationExpression="^(20)\d\d[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])$"
                    Text="<img src='gfx/redCheck.png' alt='*' title='Date must be in format yyyy/mm/dd.' />">
                </asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td>
                &nbsp 
            </td>
            <td class="ButtonCell">
                <asp:Button ID="addDate" runat="server" Text="Add Date" OnClick="AddDate"/>
            </td>
            <td></td>
        </tr>
    </table>

    <h3>Time settings</h3>
    <div  id="viewT" runat="server">
    </div>
    <table >
        <colgroup>
            <col class="Col1" />
            <col class="Col2" />                        
            <col class="Col3" />
        </colgroup>
        <tr>
            <td>
                Time:</td>
            <td>
                <asp:TextBox ID="time" runat="server" class="TextInput"></asp:TextBox>
            </td>
            <td>
                <asp:RegularExpressionValidator ID="regexTime" runat="server" Display="Dynamic"
                    ControlToValidate="time"
                    ValidationExpression="^(0[0-9]|1[0-9]|2[0-3])[:.]([0-5][0-9])$"
                    Text="<img src='gfx/redCheck.png' alt='*' title='Time must be in format hh24:mm.' />">
                </asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td>
                &nbsp 
            </td>
            <td class="ButtonCell">
                <asp:Button ID="addTime" runat="server" Text="Add Time" OnClick="AddTime" />
            </td>
            <td>&nbsp;</td>
        </tr>
    </table>

    <table>
        <colgroup>
            <col class="Col1" />
            <col class="Col2" />                        
            <col class="Col3" />
        </colgroup>
        <tr>
       <td colspan="3" style="font-weight: 700"><div id="endvotationdiv" runat="server" visible="false"> <h3>&nbsp;</h3>
           <h3>End of Votations:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;
           <asp:TextBox ID="endofvotations" runat="server" Height="24px"></asp:TextBox>
           </h3></div></td>
        </tr>
        <tr>
            <td colspan="3">&nbsp;</td>
        </tr>
        <tr>
            <td>&nbsp;</td>
            <td class="ButtonCell">
                <asp:Button ID="CreateEventButton" runat="server" class="CreateButton" Text="" OnClick="Create" />
                <input type="reset" class="ResetButton" value=""/>
            </td>
            <td></td>
        </tr>
        <tr>
            <td colspan="3">
                <p>* This fields are optional. However, in order to take advantage of all the features we suggest to fill in this fields too.            </td>
        </tr>
    </table>
    <div id="debugMessage" runat="server">
    </div>
    

</asp:Content>
